<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- start: Meta -->
    <meta charset="utf-8">
    <title>祥安消防系统</title>
    <meta name="description" content="Bootstrap Metro Dashboard">
    <meta name="author" content="Dennis Ji">
    <meta name="keyword"
          content="Metro, Metro UI, Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
    <!-- end: Meta -->

    <!-- start: Mobile Specific -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- end: Mobile Specific -->

    <!-- start: CSS -->
    <link id="bootstrap-style" href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/bootstrap-responsive.min.css" rel="stylesheet">
    <link id="base-style" href="css/style.css" rel="stylesheet">
    <link id="base-style-responsive" href="css/style-responsive.css"
          rel="stylesheet">
    <link
            href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800&subset=latin,cyrillic-ext,latin-ext'
            rel='stylesheet' type='text/css'>
    <!-- end: CSS -->


    <!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <link id="ie-style" href="css/ie.css" rel="stylesheet">
    <![endif]-->

    <!--[if IE 9]>
    <link id="ie9style" href="css/ie9.css" rel="stylesheet">
    <![endif]-->

    <!-- start: Favicon -->
    <link rel="shortcut icon" href="img/favicon.ico">
    <!-- end: Favicon -->




</head>
<body>

<!-- start: Header -->
<%@include file="header.jsp"%>
<div class="container-fluid-full">
    <div class="row-fluid">

        <!-- start: Main Menu -->
        <%@include file="mainmenu.jsp"%>
        <!-- start: Content -->
        <div id="content" class="span10">
            <ul class="breadcrumb">
                <li><i class="icon-home"></i> <a href="index.html">主页</a> <i
                        class="icon-angle-right"></i></li>
                <li><a href="#">新建采购执行</a></li>
            </ul>

            <div class="row-fluid sortable">
                <div class="box span12">
                    <div class="box-header" data-original-title>
                        <h2>
                            <i class="halflings-icon white edit"></i><span class="break"></span>新建采购执行
                        </h2>
                        <div class="box-icon">
                            <a href="#" class="btn-setting"><i
                                    class="halflings-icon white wrench"></i></a> <a href="#"
                                                                                    class="btn-minimize"><i
                                class="halflings-icon white chevron-up"></i></a> <a href="#"
                                                                                    class="btn-close"><i class="halflings-icon white remove"></i></a>
                        </div>
                    </div>
                    <div class="box-content">
                        <div class="box-content">
                            <img src="img/u2142.png">
                            <form id="formjc" class="form-horizontal" method="post" action="${pageContext.request.contextPath}/buytask_saveOrUpdate">
                                <fieldset>
                                    <input type="hidden"  id="abc" name="taskBuy.id" value="<s:property value="#taskBuy.id"/>">
                                    <div class="control-group">
                                        <label class="control-label"   style="text-align: left">*单位名称</label>
                                        <div class="controls">
                                            <select id="selectError3" data-rel="chosen" name="taskBuy.companyName">
                                                <s:iterator id="jc" value="#companyList" var="jc">
                                                    <option value="<s:property value="#jc.dict_item_name"/>"
                                                            <s:if test="#jc.dict_item_name == #taskBuy.companyName">selected</s:if>>
                                                        <s:property value="#jc.dict_item_name"/></option>
                                                </s:iterator>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="control-group">
                                        <label class="control-label" for="date01"  style="text-align: left">*执行采购时间：</label>
                                        <div class="controls">
                                            <input type="text" class="input-xlarge datepicker" id="date01"
                                            name="taskBuy.buyTime" value="<s:property value="#taskBuy.buyTime"/>">
                                        </div>
                                    </div>

                                    <div class="control-group" >
                                        <label class="control-label"style="text-align: left">*采购要求记录上传/下载</label>
                                        <div class="control-group">
                                            <input type="file" id = "chooseBox" name="file">
                                            <button class="btn btn-small btn-info" style="right: auto" onclick="">下载</button>
                                        </div>

                                    </div>
                                    <div class="control-group" >
                                        <label class="checkbox inline">
                                            <input type="checkbox" id="inlineCheckbox1" value="1" name="taskBuy.jfqzqr"
                                            <s:property value="#taskBuy.jfqzqr==1?'checked':''"/>>甲方签字确认
                                        </label>
                                        <label class="checkbox inline">
                                            <input type="checkbox" id="inlineCheckbox2" value="1" name="taskBuy.cldywtddqr"
                                            <s:property value="#taskBuy.cldywtddqr==1?'checked':''"/>> 材料对应问题调度确认
                                        </label>

                                    </div>

                                    <div class="control-group" >
                                        <label class="checkbox inline">
                                            <input type="checkbox" id="inlineCheckbox3" value="1" name="taskBuy.sbryqr"
                                            <s:property value="#taskBuy.sbryqr==1?'checked':''"/>>材料，型号，厂家，数量调度与材料申报人员确认
                                        </label>

                                    </div>

                                    <div class="box-content">
                                        <button class="btn btn-small btn-info" style="float: right;" onclick="newbuy()"> +新建采购</button>
                                        <table class="table table-striped table-bordered bootstrap-datatable datatable">
                                            <thead>
                                            <tr>
                                                <th>材料名称</th>
                                                <th>型号</th>
                                                <th>厂家</th>
                                                <th>数量</th>
                                                <th>供货商地址</th>
                                                <th>供货商联系电话</th>
                                                <th>送货地址</th>
                                                <th>物流公司</th>
                                                <th>备注</th>
                                                <th>状态</th>
                                                <th>操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <s:iterator id="jc" value="#materialList" var="jc">
                                            <tr>
                                                <td><s:property value="#jc.materialName"/></td>
                                                <td><s:property value="#jc.model"/></td>
                                                <td><s:property value="#jc.manufacturer"/></td>
                                                <td><s:property value="#jc.counts"/></td>
                                                <td><s:property value="#jc.ghsdz"/></td>
                                                <td><s:property value="#jc.ghsdh"/></td>
                                                <td><s:property value="#jc.shdz"/></td>
                                                <td><s:property value="#jc.wlgs"/></td>
                                                <td><s:property value="#jc.remarks"/></td>
                                                <td class="center">
                                                    <span class="label label-success"><s:property value="#jc.buyStatus"/></span>
                                                </td>
                                                <td class="center">
                                                    <a class="btn btn-info" onclick="editbuy('${pageContext.request.contextPath}/buytask_editmaterial?materialId=<s:property value="#jc.id"/>')" >
                                                        <i class="halflings-icon white edit"></i>
                                                    </a>
                                                    <a class="btn btn-danger" onclick="deletebuy('${pageContext.request.contextPath}/buytask_deletematerial?materialId=<s:property value="#jc.id"/>')">
                                                        <i class="halflings-icon white trash"></i>
                                                    </a>
                                                </td>
                                            </tr>
                                            </s:iterator>


                                            </tbody>
                                        </table>
                                    </div>

                                    <div class="control-group">
                                        <label class="control-label" style="text-align: left">*任务状态</label>
                                        <div class="controls">
                                            <label class="radio">
                                                <input type="radio" name="taskBuy.buystatus"
                                                       <s:property value="#taskBuy.buystatus=='任务已完成但采购未完成'?'checked':''"/>
                                                       id="optionsRadios1" value="任务已完成但采购未完成" checked="">任务已完成但采购未完成
                                            </label>
                                            <div style="clear:both"></div>
                                            <label class="radio">
                                                <input type="radio"
                                                <s:property value="#taskBuy.buystatus=='任务已完成采购已完成'?'checked':''"/>
                                                       name="taskBuy.buystatus" id="optionsRadios2" value="任务已完成采购已完成">任务已完成采购已完成
                                            </label>
                                        </div>
                                    </div>

                                    <div class="form-actions">
                                        <button class="btn" type="button" onclick="printBuy()">打印</button>
                                        <button class="btn btn-primary" onclick="checkForm()">保存</button>
                                        <button class="btn">关闭</button>
                                    </div>


                                </fieldset>
                            </form>
                        </div>

                <!--/span-->

                    </div>

                </div>

            </div>
        <!--/.fluid-container-->
        <!-- end: Content -->

        </div>
    <!--/#content.span10-->
    </div>
<!--/fluid-row-->
</div>
<%@include file="footer.jsp"%>

<!-- start: JavaScript-->

<script src="js/jquery-1.9.1.min.js"></script>
<script src="js/jquery-migrate-1.0.0.min.js"></script>

<script src="js/jquery-ui-1.10.0.custom.min.js"></script>

<script src="js/jquery.ui.touch-punch.js"></script>

<script src="js/modernizr.js"></script>

<script src="js/bootstrap.min.js"></script>

<script src="js/jquery.cookie.js"></script>

<script src='js/fullcalendar.min.js'></script>

<script src='js/jquery.dataTables.min.js'></script>

<script src="js/excanvas.js"></script>
<script src="js/jquery.flot.js"></script>
<script src="js/jquery.flot.pie.js"></script>
<script src="js/jquery.flot.stack.js"></script>
<script src="js/jquery.flot.resize.min.js"></script>

<script src="js/jquery.chosen.min.js"></script>

<script src="js/jquery.uniform.min.js"></script>

<script src="js/jquery.cleditor.min.js"></script>

<script src="js/jquery.noty.js"></script>

<script src="js/jquery.elfinder.min.js"></script>

<script src="js/jquery.raty.min.js"></script>

<script src="js/jquery.iphone.toggle.js"></script>

<script src="js/jquery.uploadify-3.1.min.js"></script>

<script src="js/jquery.gritter.min.js"></script>

<script src="js/jquery.imagesloaded.js"></script>

<script src="js/jquery.masonry.min.js"></script>

<script src="js/jquery.knob.modified.js"></script>

<script src="js/jquery.sparkline.min.js"></script>

<script src="js/counter.js"></script>

<script src="js/retina.js"></script>

<script src="js/custom.js"></script>

<script>


    $(document).ready(function(){

        if($("#abc").val().length==0){
            $("#abc").val(${bid});
        }



    });

    function printBuy() {
        var path = "${pageContext.request.contextPath}/buytask_print";
        $('#formjc').attr("action", path).submit();
    }
    function newbuy() {
        var path = "${pageContext.request.contextPath}/buytask_newmaterial";
        $('#formjc').attr("action", path).submit();

    }
    function editbuy(path) {

        $('#formjc').attr("action", path).submit();

    }
    function deletebuy(path) {
        $('#formjc').attr("action", path).submit();

    }


</script>
<!-- end: JavaScript-->

</body>
</html>